{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\logs\figure3.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}19 May 2024, 20:28:10
{txt}
{com}. 
. /* Start with Flood to CP or LEPA */
. import excel "${c -(}dr_temp{c )-}\twfe.xlsx", firstrow sheet(floodtocplepa_91_15_nyt) clear
{res}{text}(10 vars, 3 obs)

{com}.         gen est = "twfe"
{txt}
{com}.         replace lb_estimate = estimate - 1.96*se_estimate
{txt}variable {bf}{res}lb_estimate{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         replace ub_estimate = estimate + 1.96*se_estimate
{txt}variable {bf}{res}ub_estimate{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         replace scaled_estimate = 100*estimate/panel_mean_dep_var
{txt}variable {bf}{res}scaled_estimate{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         replace scaled_lb = 100*lb_estimate/panel_mean_dep_var
{txt}variable {bf}{res}scaled_lb{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         replace scaled_ub = 100*ub_estimate/panel_mean_dep_var
{txt}variable {bf}{res}scaled_ub{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         keep dep_var est scaled_estimate scaled_lb scaled_ub estimate se_estimate lb_estimate ub_estimate
{txt}
{com}.         save "${c -(}dr_temp{c )-}\floodtocplepa_twfe.dta", replace
{txt}{p 0 4 2}
file {bf}
C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\data\intermediate\floodtocplepa_twfe.dta{rm}
saved
{p_end}

{com}.         
. import excel "${c -(}dr_temp{c )-}/cs_floodtocporlepa_91_15_nyt.xlsx", firstrow sheet(cs_att) clear
{res}{text}(8 vars, 6 obs)

{com}.         keep if effect_estimated=="group_agg_effect_average"
{txt}(3 observations deleted)

{com}.         gen est = "cs"
{txt}
{com}.         gen scaled_estimate = 100*estimate/panel_mean_dep_var
{txt}
{com}.         gen scaled_lb = 100*ci_95_lb/panel_mean_dep_var
{txt}
{com}.         gen scaled_ub = 100*ci_95_ub/panel_mean_dep_var
{txt}
{com}.         rename (ci_95_lb ci_95_ub) (lb_estimate ub_estimate)
{res}{txt}
{com}.         keep dep_var est scaled_estimate scaled_lb scaled_ub estimate se_estimate lb_estimate ub_estimate
{txt}
{com}.         save "${c -(}dr_temp{c )-}\floodtocplepa_cs.dta", replace
{txt}{p 0 4 2}
file {bf}
C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\data\intermediate\floodtocplepa_cs.dta{rm}
saved
{p_end}

{com}. 
.         *Append the TWFE results 
.         append using "${c -(}dr_temp{c )-}\floodtocplepa_twfe.dta"
{txt}{p 0 7 2}
(variable
{bf:est} was {bf:str2}, now {bf:str4} to accommodate using data's values)
{p_end}

{com}. 
. ******* Table C.1 - ATT estimates in levels for TWFE and CS estimators *********
.         *Generate column indicating tech transition and save
.         gen transition = "flood_to_cp"
{txt}
{com}.         save "${c -(}dr_output_app{c )-}\floodtocplepa_att_twfecs.dta", replace 
{txt}{p 0 4 2}
file {bf}
C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\appendices\floodtocplepa_att_twfecs.dta{rm}
saved
{p_end}

{com}.         
. /* Now CP to LEPA */
. import excel "${c -(}dr_temp{c )-}\twfe.xlsx", firstrow sheet(cptolepa_91_19) clear
{res}{text}(10 vars, 3 obs)

{com}.         gen est = "twfe"
{txt}
{com}.         replace lb_estimate = estimate - 1.96*se_estimate
{txt}variable {bf}{res}lb_estimate{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         replace ub_estimate = estimate + 1.96*se_estimate
{txt}variable {bf}{res}ub_estimate{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         replace scaled_estimate = 100*estimate/panel_mean_dep_var
{txt}variable {bf}{res}scaled_estimate{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         replace scaled_lb = 100*lb_estimate/panel_mean_dep_var
{txt}variable {bf}{res}scaled_lb{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         replace scaled_ub = 100*ub_estimate/panel_mean_dep_var
{txt}variable {bf}{res}scaled_ub{sf}{txt} was {bf}{res}byte{sf}{txt} now {bf}{res}float{sf}
{txt}(3 real changes made)

{com}.         keep dep_var est scaled_estimate scaled_lb scaled_ub estimate se_estimate lb_estimate ub_estimate
{txt}
{com}.         save "${c -(}dr_temp{c )-}\cptolepa_twfe.dta", replace
{txt}{p 0 4 2}
file {bf}
C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\data\intermediate\cptolepa_twfe.dta{rm}
saved
{p_end}

{com}.         
. import excel "${c -(}dr_temp{c )-}/cs_cptolepa.xlsx", firstrow sheet(cs_att) clear
{res}{text}(8 vars, 6 obs)

{com}.         keep if effect_estimated=="group_agg_effect_average"
{txt}(3 observations deleted)

{com}.         gen est = "cs"
{txt}
{com}.         gen scaled_estimate = 100*estimate/panel_mean_dep_var
{txt}
{com}.         gen scaled_lb = 100*ci_95_lb/panel_mean_dep_var
{txt}
{com}.         gen scaled_ub = 100*ci_95_ub/panel_mean_dep_var
{txt}
{com}.         rename (ci_95_lb ci_95_ub) (lb_estimate ub_estimate)
{res}{txt}
{com}.         keep dep_var est scaled_estimate scaled_lb scaled_ub estimate se_estimate lb_estimate ub_estimate
{txt}
{com}.         save "${c -(}dr_temp{c )-}\cptolepa_cs.dta", replace
{txt}{p 0 4 2}
file {bf}
C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\data\intermediate\cptolepa_cs.dta{rm}
saved
{p_end}

{com}.         
.         *Append the TWFE results 
.         append using "${c -(}dr_temp{c )-}\cptolepa_twfe.dta"
{txt}{p 0 7 2}
(variable
{bf:est} was {bf:str2}, now {bf:str4} to accommodate using data's values)
{p_end}

{com}. 
. ******* Table C.1 - ATT estimates in levels for TWFE and CS estimators *********
.         *Generate column indicating tech transition and save
.         gen transition = "cp_to_lepa"
{txt}
{com}.         save "${c -(}dr_output_app{c )-}\cptolepa_att_twfecs.dta", replace 
{txt}{p 0 4 2}
file {bf}
C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\appendices\cptolepa_att_twfecs.dta{rm}
saved
{p_end}

{com}. 
. ********************************************************************************
. ** Figure 3 - Plot ATT estimates in percent terms for TWFE and CS estimators ***
. ********************************************************************************
. *Combine all estimated ATTs for all estimators and transitions
.         append using "${c -(}dr_output_app{c )-}\floodtocplepa_att_twfecs.dta"
{txt}{p 0 7 2}
(variable
{bf:transition} was {bf:str10}, now {bf:str11} to accommodate using data's values)
{p_end}

{com}.         *Make numerical variable encoding estimator 
.         gen estimator = 1 if est=="cs"
{txt}(6 missing values generated)

{com}.         replace estimator = 2 if est=="twfe"
{txt}(6 real changes made)

{com}.         drop if est=="cd"
{txt}(0 observations deleted)

{com}. 
. /* Create plot for each dependent variable */
.         *Acre-ft
.         tw (rcap scaled_lb scaled_ub estimator if transition=="flood_to_cp" & ///
>                 dep_var=="af_used", lcolor("navy")) ///
>                 (scatter scaled_estimate estimator if transition=="flood_to_cp" & ///
>                 dep_var=="af_used", mcolor("navy") msize(small)), ///  
>                 title("Acre-feet withdrawn", size(mediumsmall)) ///
>                 yscale(range(-15 15)) ylabel(-15(5)15, labsize(small)) xscale(range(.8 2.2)) ///
>                 legend(off) ///
>                 yline(0, lpattern(solid)) ///
>                 ytitle("") xtitle("") ///
>                 xlabel(1 "{c -(}it{c )-}{c -(}&delta{c )-}{c -(}superscript:CS{c )-}" 2 "{c -(}it{c )-}{c -(}&beta{c )-}{c -(}superscript:TWFE{c )-}", labsize(medium)) ///
>                 graphregion(color(white) margin (1 1 1 8)) ///
>                 text(23 .3 "A. Flood to center pivot", place(e) size(medium)) ///
>                 xsize(2.5) ysize(3) ///
>                 name(flood_cp_acreft, replace)          
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{res}{txt}
{com}.                 
.         *Acres irrigated
.         tw (rcap scaled_lb scaled_ub estimator if transition=="flood_to_cp" & ///
>                 dep_var=="acres_irr", lcolor("navy")) ///
>                 (scatter scaled_estimate estimator if transition=="flood_to_cp" & ///
>                 dep_var=="acres_irr", mcolor("navy") msize(small)), ///  
>                 title("Acres irrigated", size(mediumsmall)) ///
>                 yscale(range(-15 15)) ylabel(-15(5)15, labsize(small)) xscale(range(.8 2.2)) ///
>                 legend(off) ///
>                 yline(0, lpattern(solid)) ///
>                 ytitle("") xtitle("") ///
>                 xlabel(1 "{c -(}it{c )-}{c -(}&delta{c )-}{c -(}superscript:CS{c )-}" 2 "{c -(}it{c )-}{c -(}&beta{c )-}{c -(}superscript:TWFE{c )-}", labsize(medium)) ///
>                 graphregion(color(white) margin (1 1 1 8)) ///
>                 xsize(2) ysize(3) ///
>                 name(flood_cp_acresirr, replace)
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{res}{txt}
{com}.                 
.         *Depth applied, estimates that passed placebo in navy, failed in red
.         tw (rcap scaled_lb scaled_ub estimator if transition=="flood_to_cp" & ///
>                 dep_var=="depth_applied", lcolor("navy")) ///
>                 (scatter scaled_estimate estimator if transition=="flood_to_cp" & ///
>                 dep_var=="depth_applied", mcolor("navy") msize(small)), ///  
>                 title("Depth applied", size(mediumsmall)) ///
>                 yscale(range(-15 15)) ylabel(-15(5)15, labsize(small)) xscale(range(.8 2.2)) ///
>                 legend(off) ///
>                 yline(0, lpattern(solid)) ///
>                 ytitle("") xtitle("") ///
>                 xlabel(1 "{c -(}it{c )-}{c -(}&delta{c )-}{c -(}superscript:CS{c )-}" 2 "{c -(}it{c )-}{c -(}&beta{c )-}{c -(}superscript:TWFE{c )-}", labsize(medium)) ///
>                 graphregion(color(white) margin (1 1 1 8)) ///
>                 xsize(2) ysize(3) ///
>                 name(flood_cp_depthapp, replace)
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{res}{txt}
{com}.                 
.         *Combine all the flood to cp graphs 
.                 graph combine flood_cp_acreft flood_cp_acresirr flood_cp_depthapp, ///
>                 rows(1) cols(3) ///
>                 l1title("Percent change", size(small)) ///
>                 xsize(6.5) ysize(2.65) name(flood_cp_all, replace)
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{res}{txt}
{com}.                         
. **# CP to cp with Lepa
.         *Acre-ft, estimates that passed placebo in navy, failed in red
.         tw (rcap scaled_lb scaled_ub estimator if transition=="cp_to_lepa" & ///
>                 dep_var=="af_used", lcolor("navy")) ///
>                 (scatter scaled_estimate estimator if transition=="cp_to_lepa" & ///
>                 dep_var=="af_used", mcolor("navy") msize(small)), ///  
>                 title("Acre-feet withdrawn", size(mediumsmall)) ///
>                 yscale(range(-10 5)) ylabel(-10(2.5)5, labsize(small)) xscale(range(.8 2.2)) ///
>                 legend(off) ///
>                 yline(0, lpattern(solid)) ///
>                 ytitle("") xtitle("") ///
>                 xlabel(1 "{c -(}it{c )-}{c -(}&delta{c )-}{c -(}superscript:CS{c )-}" 2 "{c -(}it{c )-}{c -(}&beta{c )-}{c -(}superscript:TWFE{c )-}", labsize(medium)) ///
>                 graphregion(color(white) margin (1 1 1 8)) ///
>                 text(8.8 .29 "B. Traditional center pivot to LEPA", place(e) size(medium)) ///
>                 xsize(2.5) ysize(3) ///
>                 name(cp_lepa_acreft, replace) 
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{res}{txt}
{com}.                 
.         *Acres irrigated, estimates that passed placebo in navy, failed in red
.         tw (rcap scaled_lb scaled_ub estimator if transition=="cp_to_lepa" & ///
>                 dep_var=="acres_irr", lcolor("navy")) ///
>                 (scatter scaled_estimate estimator if transition=="cp_to_lepa" & ///
>                 dep_var=="acres_irr", mcolor("navy") msize(small)), ///  
>                 title("Acres irrigated", size(mediumsmall)) ///
>                 yscale(range(-10 5)) ylabel(-10(2.5)5, labsize(small)) xscale(range(.8 2.2)) ///
>                 legend(off) ///
>                 yline(0, lpattern(solid)) ///
>                 ytitle("") xtitle("") ///
>                 xlabel(1 "{c -(}it{c )-}{c -(}&delta{c )-}{c -(}superscript:CS{c )-}" 2 "{c -(}it{c )-}{c -(}&beta{c )-}{c -(}superscript:TWFE{c )-}", labsize(medium)) ///
>                 graphregion(color(white) margin (1 1 1 8)) /// 
>                 xsize(2) ysize(3) ///
>                 name(cp_lepa_acresirr, replace)
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{res}{txt}
{com}.                 
.         *Depth applied, estimates that passed placebo in navy, failed in red
.         tw (rcap scaled_lb scaled_ub estimator if transition=="cp_to_lepa" & ///
>                 dep_var=="depth_applied", lcolor("navy")) ///
>                 (scatter scaled_estimate estimator if transition=="cp_to_lepa" & ///
>                 dep_var=="depth_applied", mcolor("navy") msize(small)), ///  
>                 title("Depth applied", size(mediumsmall)) ///
>                 yscale(range(-10 5)) ylabel(-10(2.5)5, labsize(small)) xscale(range(.8 2.2)) ///
>                 legend(off) ///
>                 yline(0, lpattern(solid)) ///
>                 ytitle("") xtitle("") ///
>                 xlabel(1 "{c -(}it{c )-}{c -(}&delta{c )-}{c -(}superscript:CS{c )-}" 2 "{c -(}it{c )-}{c -(}&beta{c )-}{c -(}superscript:TWFE{c )-}", labsize(medium)) ///
>                 graphregion(color(white) margin (1 1 1 8)) ///
>                 xsize(2) ysize(3) ///
>                 name(cp_lepa_depthapp, replace)
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{res}{txt}
{com}.                 
.         *Combine all the cp to LEPA graphs
.                 graph combine cp_lepa_acreft cp_lepa_acresirr cp_lepa_depthapp, ///
>                 rows(1) cols(3) ///
>                 l1title("Percent change", size(small)) ///
>                 xsize(6.5) ysize(2.65) name(cp_lepa_all, replace)
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{res}{txt}
{com}.         
. *Combine the graphs     
. graph combine flood_cp_all cp_lepa_all, ///
>         rows(2) cols(1) ///
>         b1title("Estimator", size(small)) ///
>         xsize(6.5) ysize(8) 
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
mediumsmall not found in class
gsize,  default attributes used)
{p_end}
{res}{txt}
{com}. graph export "${c -(}dr_output_main{c )-}\figure3.tif", width(6500) height(7800) replace 
{txt}{p 0 4 2}
file {bf}
C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\main_text\figure3.tif{rm}
saved as
TIFF
format
{p_end}

{com}. 
. *Close log
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\Micah\Dropbox\Irrigation technology transition\final revisions for conditional acceptance\replication materials\outputs\logs\figure3.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}19 May 2024, 20:28:39
{txt}{.-}
{smcl}
{txt}{sf}{ul off}